import maxios from '../maxios'
class staticServe {
  // 获取餐厅数据
  getCanteen() {
    return new Promise((resolve, reject) => {
      maxios.get_local(
        'json/canteen.json',
        {}, //没有参数要传一个空对象
        (res) => {
          resolve(res)
        },
        (err) => {
          reject(err)
        }
      )
    })
  }
  // 获取本地新闻数据
  getNews() {
    return new Promise((resolve, reject) => {
      maxios.get_local(
        'json/news.json',
        {}, //没有参数要传一个空对象
        (res) => {
          resolve(res)
        },
        (err) => {
          reject(err)
        }
      )
    })
  }
  // 获取恒星商城数据
  getSupermarketList() {
    return new Promise((resolve, reject) => {
      maxios.get_local(
        'json/supermarket.json',
        {},
        (res) => {
          resolve(res)
        },
        (err) => {
          reject(err)
        }
      )
    })
  }
  // 规章制度，测试
  getList() {
    return new Promise((resolve, reject) => {
      maxios.get_local('json/regular.json', {}, (res) => {
        resolve(res)
        ;(err) => {
          reject(err)
        }
      })
    })
  }
}
export default new staticServe()
